<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags"%>

<html>
	<head>
		<title>搜索</title>
		<sx:head />
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	</head>
	<body>
		<s:form action="/search/any/searchArticleByUserAccount" theme="simple">
			<table>
			  <tr>
			    <th>按用户名搜索:</th>
			    <td>
			    	<s:url id="dataUrl" value="/search/any/serachUser.json" />
					<sx:autocompleter name="start" href="%{dataUrl}" loadOnTextChange="true"
						indicator="iconForLoading" loadMinimumCount="1" autoComplete="false"
						showDownArrow="false" dataFieldName="root" />
					<s:url id="imageUrl" value="/images/indicator.gif" />
					<img id="iconForLoading" src='${request.contextPath}/images/indicator.gif' alt="Loading..." style="display: none;" >
			    </td>
			    <td><s:submit /></td>
			  </tr>
			</table>
		</s:form>
	<s:if test="articles==null||articles.size<=0">
		没有搜索条件或者没有搜索到相应的记录!
	</s:if>
	<s:else>
		<table style="width: 600px;">
			<tr style="font-size: x-small; font-weight: lighter;background: #cd853f;">
				<td style="width: 50px;">状态</td>
				<td style="width: 300px;">标题</td>
				<td style="width: 50px;">作者</td>
				<td style="width: 50px;">回帖数</td>
				<td style="width: 50px;">点击数</td>
				<td style="width: 100px;">最后发表</td>
			</tr>
			<s:iterator value="%{articles}">
				<tr>
					<td valign="top" class="articleTitle">有新帖</td>
					<td valign="top" class="articleTitle">
						<s:url id="articleShow" value="/article"/>
						<s:a href="%{articleShow}/%{id}">
							<s:property value="title" />&nbsp;
						</s:a>
					</td>
					<td valign="top" class="articleTitle">
						<s:property value="userName" /><br>
						<s:date format="yyyy-MM-dd HH:mm" name="updateTime"/>
					</td>
					<td valign="top" class="articleTitle"><s:property value="postNo" /></td>
					<td valign="top" class="articleTitle"><s:property value="clickNo" />&nbsp;</td>
					<td valign="top" class="articleTitle">
						<s:date format="yyyy-MM-dd HH:mm" name="lastPostDate"/><br>
						by <s:property value="lastPostUserName" />
					</td>
				</tr>
			</s:iterator>
		</table>
	</s:else>
	</body>
</html>